﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EcoSystem.Permissions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace EcoSystem.Dictionarys;

/// <summary>
/// 后端枚举数据项查询控制器
/// </summary>
[Area(EcoSystemRemoteServiceConsts.ModuleName)]
[RemoteService(Name = EcoSystemRemoteServiceConsts.RemoteServiceName)]
[Route("api/Platform/enum")]
public class EnumController : EcoSystemController, IEnumAppService
{
    private readonly IEnumAppService _service;

    public EnumController(IEnumAppService service)
    {
        _service = service;
    }

    /// <summary>
    /// 获取所有枚举数据
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public async Task<EnumsListResultDto> GetEnumItemsAsync()
    {
        return await _service.GetEnumItemsAsync();
    }
}
